package com.mdlib.helper.ui.adapter;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ljlib.help.R;
import com.mdlib.helper.model.entity.OneKeyServiceEntity;

import java.util.List;

/**
 * 作者：HQY on 16/12/7 13:54
 * 邮箱：hqy_xz@126.com
 */

public class QuickServiceAdapter extends BaseQuickAdapter<OneKeyServiceEntity> {

    public QuickServiceAdapter(List<OneKeyServiceEntity> data) {
        super(R.layout.item_quick_service, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, OneKeyServiceEntity oneKeyServiceEntity) {
        baseViewHolder.setText(R.id.tv_quick_service_name, oneKeyServiceEntity.getName());

        Glide.with(mContext)
                .load("http://www."+oneKeyServiceEntity.getPath())
                .placeholder(R.drawable.iv_send_home_0)
                .error(R.drawable.iv_send_home_0)
                .into((ImageView) baseViewHolder.getView(R.id.iv_quick_service_pic));
    }
}
